package pkev.xgrapher.common;

import pkev.xgrapher.Constants;

/**
 * Created with IntelliJ IDEA.
 * User: pkev
 * Date: 17.10.13
 * Time: 0:38
 * To change this template use File | Settings | File Templates.
 */
public class CoordinatesProcessor {
    public static int processX(double x) {
        return (int) (Constants.ABS_CENTER_X + (x * Constants.SCALE));
    }

    public static int processY(double y) {
        return (int) (Constants.ABS_CENTER_Y - (y * Constants.SCALE));
    }

    public static double getRelativeX(int x) {
        return (x - Constants.ABS_CENTER_X) / Constants.SCALE;
    }

    public static double getRelativeY(int y) {
        return -(y - Constants.ABS_CENTER_Y) / Constants.SCALE;
    }
}
